public class SpreadUrl {
	private String protocol;
	private String domain;
	private String path;
	private String paramsW;
	private String paramsC;
	private String paramsI;
	private String paramsPf;
	private String paramsE;

	private final String HTTP_PROTOCOL = "http";
	private final String HTTPS_PROTOCOL = "https";
	private final String COMMON_DOMAIN = "p.gouwuke.com";
	private final String COMMON_PATH = "c";
	private final String COMMON_W = "625700";
	private final String COMMON_PF = "h";
	private final String COMMON_E = "";

	public SpreadUrl(int brandId) {
		domain = COMMON_DOMAIN;
		path = COMMON_PATH;
		paramsW = COMMON_W;
		paramsPf = COMMON_PF;
		paramsE = COMMON_E;

		switch (brandId) {
		case 1://京东
			protocol = HTTPS_PROTOCOL;
			paramsC = "18257";
			paramsI = "42919";
			break;
		case 2://1号店
			protocol = HTTPS_PROTOCOL;
			paramsC = "6951";
			paramsI = "25362";
			break;
		case 3://考拉海购
			protocol = HTTP_PROTOCOL;
			paramsC = "18318";
			paramsI = "42876";
			break;
		}
	}

	public String generateUrl(String url) {
		return protocol + "://" + domain + "/" + path + "?w=" + paramsW + "&c=" + paramsC + "&i=" + paramsI + "&pf="
				+ paramsPf + "&e=" + paramsE + "&t=" + url;
	}
}
